<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Profile
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        <% Html.RenderPartial("LogOnUserControl"); %>
    </h2>
    <fieldset>
        <table>
            <thead>
                <tr>
                    <th>
                        Username
                    </th>
                    <th>
                        First Name
                    </th>
                    <th>
                        Last Name
                    </th>
                    <th>
                        Email
                    </th>
                    <th>
                        Date Joined
                    </th>
                </tr>
            </thead>
            <% 
                var user = (HyperLocal.Core.LocalOrbUser)ViewData["CurrentUser"];
                var profile = user.LocalOrbProfiles.First<HyperLocal.Core.LocalOrbProfile>();
                var Roles = user.LocalOrbRolesXrefs;

                Response.Write("<td>" + user.UserName + "</td>");
                Response.Write("<td>" + profile.FirstName + "</td>");
                Response.Write("<td>" + profile.LastName + "</td>");
                Response.Write("<td>" + user.Email + "</td>");
                Response.Write("<td>" + user.DateCreated + "</td>");
        
            %>
        </table>
        <div>

            
            <img src="/Profile/ProfileImage" alt="UpLoad a Profile Image" width="250" />
        </div>
        <div>
            <%
            
                HyperLocal.Core.LocalOrbUserAddress address = new HyperLocal.Core.LocalOrbUserAddress();
                if (user.LocalOrbUserAddresses.Count<HyperLocal.Core.LocalOrbUserAddress>() > 0)
                {
                    address = user.LocalOrbUserAddresses.First<HyperLocal.Core.LocalOrbUserAddress>();
                }
            %>
            <p>
                <%= Html.Encode(address.FullAddress) %>
            </p>
        </div>
    </fieldset>
    <div style="float: left;">
        Community Options
        <fieldset>
            <ul>
                <li>
                    <%= Html.ActionLink("Create Message", "Create", "Message") %></li>
                <li>
                    <%= Html.ActionLink("View Message", "Index", "Message") %></li>
                <li>
                    <%= Html.ActionLink("Create Event", "Create", "Event") %></li>
                <li>
                    <%= Html.ActionLink("View Events", "Index", "Event") %></li>
            </ul>
        </fieldset>
    </div>
    <div style="float: left">
        User Related Options
        <fieldset>
            <ul>
                <li>
                    <%= Html.ActionLink("Choose Community", "ChooseCommunity") %></li>
                <li>
                    <%= Html.ActionLink("Edit Your Profile", "Edit", new { id = user.LocalOrbUserId })%></li>
                <li>
                    <%= Html.ActionLink("Manage Albums", "Index","Album")%></li>
            </ul>
        </fieldset>
    </div>
</asp:Content>
